package cn.ickck.law_paper_final.service.Impl;

import cn.ickck.law_paper_final.mapper.PaBatchDAO;
import cn.ickck.law_paper_final.model.entity.PaBatch;
import cn.ickck.law_paper_final.service.PaBatchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: ck
 * @Description:
 * @Date: Create in 13:08 2020/12/13
 */
@Service
public class PaBatchServiceImpl implements PaBatchService {
    @Autowired
    private PaBatchDAO paBatchDAO;
    @Override
    public void update(PaBatch paBatch) {
        paBatchDAO.updateByPrimaryKeySelective(paBatch);
    }

    @Override
    public Integer insert(PaBatch paBatch) {
        return paBatchDAO.insertSelective(paBatch);
    }

    @Override
    public int count() {
        return paBatchDAO.count();
    }

    @Override
    public List<PaBatch> selectByPage(int start, int end) {
        return paBatchDAO.selectByPage(start,end);
    }

    @Override
    public List<PaBatch> selectByName(String key) {
        return paBatchDAO.selectByName(key);
    }

    @Override
    public String selectKeyById(Integer id) {
        return paBatchDAO.selectKeyById(id);
    }

    @Override
    public void deleteById(Integer id) {
        paBatchDAO.deleteByPrimaryKey(id);
    }
}
